<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增合同分类')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-type-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">分类名称：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">英文名称：</label>
                <div class="col-sm-8">
                    <input name="englishName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">图片：</label>
                <div class="col-sm-8">
                    <input id="filePath" name="filePath" class="form-control" type="file">
                    <input id="pictureUrl" name="pictureUrl" type="text" hidden>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">图片2：</label>
                <div class="col-sm-8">
                    <input id="filePath2" name="filePath2" class="form-control" type="file">
                    <input id="pictureUrl2" name="pictureUrl2" type="text" hidden>
                </div>
            </div>
           <!-- <div class="form-group">
                <label class="col-sm-3 control-label">删除标志：</label>
                <div class="col-sm-8">
                    <input name="delFlag" class="form-control" type="text">
                </div>
            </div>-->
           <!-- <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" class="form-control" type="text">
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "front/contractType";
        $("#form-type-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                let result = uploadFile(false, "pictureUrl");
                if (result != web_status.SUCCESS) {
                    return;
                }
                let result2 = uploadMoreFile(false, "pictureUrl2","filePath2");
                if (result2 != web_status.SUCCESS) {
                    return;
                }
                $.operate.save(prefix + "/add", $('#form-type-add').serialize());
            }
        }
    </script>
</body>
</html>